<template>
    <div class="wpwork-preview-main user-form">
      <el-row class="wpwork-common-search-box" :gutter="16" style="margin-bottom: 10px;">
        <el-form @submit.native.prevent>
          <el-col :span="6">
            <el-form-item label="终端号码：">
              <el-input v-model="listQuery.terminalNumber"   placeholder="请输入终端号码"
                        clearable @keyup.enter.native="search()" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="名称：">
              <el-input v-model="listQuery.name"   placeholder="请输入名称"
                        clearable @keyup.enter.native="search()" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" @click="search()">
                {{$t('common.search')}}</el-button>
              <el-button icon="el-icon-refresh-right" @click="reset()">{{$t('common.reset')}}
              </el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="wpwork-common-layout-main wpwork-flex-main" style="margin-top: -10px;">
        <wpwork-table v-loading="listLoading" :data="tableData" :hasNO="false">
          <el-table-column prop="realName" label="人员名称" width="100" align="center"/>
          <el-table-column prop="insTime" label="巡检时间" :formatter="wpwork.tableDateFormat"
            width="140" />
          <el-table-column prop="inspointName" label="巡检点名称" width="100" />
          <el-table-column prop="fkx" label="反馈项" width="120" />
          <el-table-column prop="remark" label="备注" min-width="170" show-overflow-tooltip align="center" />

          <el-table-column prop="jd" label="经度" width="120" />
          <el-table-column prop="wd" label="纬度" width="120" />
          <el-table-column prop="insPoint" label="巡检位置" min-width="170" show-overflow-tooltip align="center" />
          <el-table-column label="操作" >
            <template slot-scope="scope" v-if="!scope.row.isAdministrator">
              <el-button size="mini" type="text"  @click="handleUpdateState(scope.row)">
                查看地图
              </el-button>
            </template>
          </el-table-column>
        </wpwork-table>
        <pagination :total="total" :page.sync="listQuery.currentPage"
          :limit.sync="listQuery.pageSize" @pagination="initData" />
      </div>  
    </div>
</template>

<script>
export default {
  name: 'inspection',
  components: {
  },
  data() {
    return {
      tableData: [],
      listLoading: true,
      listQuery: {
        organizeId: '',
        keyword: '',
        gender: '',
        enabledMark: '',
        currentPage: 1,
        pageSize: 20
      },
      total: 0,
      
    }
  },
  watch: {
   
  },
  computed: {
    
  },
  created() {
    this.getOrganizeList(true)
  },
  methods: {
    getOrganizeList(isInit) {
      if (isInit) this.initData()
    },
    initData() {
      this.listLoading = true
      this.tableData = [
        {
          "id": "1",
          "inspointName": "巡检点1",
          "realName":"测试人员1",
          "insTime":1755500342000,
          "fkx":"反馈项1",
          "endTime":1755500382000,
          "remark":"备注1",
          "jd":"119.332",
          "wd":"26.331",
          "insPoint": "巡检位置1",
          "imageUrls": [
            require('@/assets/images/t4.png')
          ]
        },
        {
          "id": "2",
          "inspointName": "巡检点2",
          "realName":"测试人员2",
          "insTime":1755500342000,
          "fkx":"反馈项2",
          "endTime":1755500382000,
          "remark":"备注2",
          "jd":"119.332",
          "wd":"26.331",
          "insPoint": "巡检位置2",
          "imageUrls": [
            require('@/assets/images/t3.png')
          ]
        },
      ]
      setTimeout(() => {
          this.listLoading = false
       }, 600)
    },
    reset() {
      this.listQuery.startDate = ''
      this.listQuery.endDate = ''
      this.initData()
    },
  }
}
</script>
<style lang="scss" scoped>
.user-form{
  margin-top: 65px;
  height: 92%;
}
@media (max-width: 1268px) { 
  .user-form {
      margin-top: 98px;

  }
}
@media (max-width: 768px) { 
  .user-form {
      margin-top: 168px;

  }
}
>>> .icon-ym {
  font-size: 12px !important;
}
</style>